import urllib.request


# 下载一个网页 url 是下载的路径  filename是文件的名字
url_page = 'http://www.baidu.com/'

# urllib.request.urlretrieve(url=url_page)
# urllib.request.urlretrieve(url_page, 'baidu.html')


# 下载一个图片
url_image = 'https://img0.baidu.com/it/u=4133694680,3312308545&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1736'
# urllib.request.urlretrieve(url_image, filename='lyf.jpg')

# 下载一个视频
url_video = '//f.video.weibocdn.com/o0/eabudcgrlx08mR1iEFT201041200myQD0E010.mp4?label=mp4_720p&template=720x1280.24.0&media_id=5146737342349368&tp=8x8A3El:YTkl0eM8&us=0&ori=1&bf=4&ot=v&ps=3lckmu&uid=3ZoTIp&ab=,15568-g4,8013-g0,3601-g39&Expires=1742565694&ssig=0CbrC%2F0T2K&KID=unistore,video'

urllib.request.urlretrieve(url_video, filename='lyf.mp4')